package com.li.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.ndboo.reslibrary.R;


/**
 * Author: Li
 * Date: 2017/9/28 0028
 * Description:
 */

public class TextEditText extends FrameLayout {
    public TextEditText(@NonNull Context context) {
        super(context);
    }

    private TextView mTxtLeft;

    public EditText getEtRight() {
        return mEtRight;
    }

    private EditText mEtRight;
    public TextEditText(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        View view= LayoutInflater.from(context).inflate(R.layout.layout_txt_et,this);
        mTxtLeft=view.findViewById(R.id.txt_left);
        mEtRight=view.findViewById(R.id.et_right);
        TypedArray array=context.obtainStyledAttributes(attrs,R.styleable.TextEditText);
        String txt=array.getString(R.styleable.TextEditText_te_txt_left);
        mTxtLeft.setText(txt);
        array.recycle();
    }
    public String getEtTxt(){
        return mEtRight.getText().toString();
    }


    public void setEtTxt(String txt){
        mEtRight.setText(txt);
    }
}
